<?php
/**
 * Created by PhpStorm.
 * User: NeverGiveUp
 * Date: 2017/10/25
 * Time: 16:04
 */

namespace Home\Model;


use Think\Model;

class ArticleModel extends Model
{
    protected $_validate = array(
      array('title','require','标题必须填写'),
      array('content','require','内容不能为空'),

    );
    protected $_auto = array(
      array('edit_at','time',Model::MODEL_BOTH,'function')
    );
}
class UserModel extends Model
{
    protected $_validate = array(
        array('email','email','邮箱格式错误'),
        array('password','/^([a-z]|[0-9]){6,12}$/','密码格式错误',0,regex)
    );
    protected $_auto = array(
        array('login_times','time',Model::MODEL_BOTH,'function')
    );
}